<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" id="html">
    <head>
        <title></title>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <base href="<?= base_url(1); ?>" />
        <link type="text/css" href="css/main.css?v=<?= $config['version'] ?>" rel="stylesheet" />
    </head>
    <body>
        <?php include(VIEWPATH . 'common/main_header.php'); ?>
        <div class="datalist"><table id="flexigrid" style="display:none"></table></div>
        <script type="text/javascript">
            $(function() {
                $("#flexigrid").flexigrid($.extend(SG.flexOptions, {
                    url: '<?= site_url('role/admin/flexigrid') ?>',
                    colModel: [
                        {display: '<?= translate('ROLE_ADMIN_ID') ?>', name: 'a.id', width: '250', iskey: true},
                        {display: '<?= translate('GROUP') ?>', name: 'r.name', width: '100', sortable: false, process: formatSearch},
                        {display: '<?= translate('USERNAME') ?>', name: 'a.username', width: '120', sortable: false, process: formatSearch},
                        {display: '<?= translate('GENDER') ?>', name: 'a.sex', width: '50', process: formatSex},
                        {display: '<?= translate('PAGESIZE') ?>', name: 'a.pagesize', width: '50', process: formatSearch},
                        {display: '<?= translate('CREATETIME') ?>', name: 'a.createtime', width: '140'},
                        {display: '<?= translate('LOGINTIME') ?>', name: 'a.logintime', width: '140'},
                        {display: '<?= translate('MANAGE') ?>', name: 'a.id', width: '120', sortable: false, process: formatOp},
                    ],
                    buttons: [
                        <?php if (check_level_menu(50, 'role', 'admin', 'add')) { ?>
                            {name: 'add', displayname: "<?= translate('ADD') ?>", title: "<?= translate('ADD') ?>", bclass: 'add', onpress: multi},
                            {name: 'delete', displayname: "<?= translate('DEL') ?>", title: "<?= translate('DEL') ?>", bclass: 'delete', onpress: multi},
                        <?php } ?>
                    ],
                    searchitems: true,
                    sortname: 'a.id',
                    sortorder: 'desc',
                }));
                SG.admin = $.extend(SG.admin, {
                    add_url: '<?= site_url("role/admin/add/") ?>',
                    edit_url: '<?= site_url("role/admin/edit/") ?>',
                    del_url: '<?= site_url("role/admin/del/") ?>',
                    multi_url: '<?= site_url("role/admin/multi/") ?>',
                    table: '{pre}account'
                });
            });
        </script>
    </body>
</html>